package com.jiawei.note.adapter;

import android.widget.CheckBox;
import android.widget.RadioButton;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.jiawei.note.R;
import com.jiawei.note.entity.TypeEntity;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
 * @Author : yaotianxue
 * @Time : On 2023/9/18 16:50
 * @Description : TypeAdapter
 */
public class TypeAdapter extends BaseQuickAdapter<TypeEntity, BaseViewHolder> {

    public TypeAdapter(int layoutResId, @Nullable List<TypeEntity> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, TypeEntity typeEntity) {
        CheckBox cb = baseViewHolder.getView(R.id.cb);
        cb.setText(typeEntity.getTypeName());
        cb.setChecked(typeEntity.isSelect());
    }
}
